<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="pcfg" scope="page" class="dsp.database.Operation"/>
<%@include file="getadminsession.jsp"%>
<%
request.setCharacterEncoding("GB2312");
%>
<%
String sql = "UPDATE sys_cfg SET value='" + request.getParameter("sitename")+ "' WHERE id=1";
pcfg.update(sql);
sql = "UPDATE sys_cfg SET value='" + request.getParameter("template")+ "' WHERE id=2";
pcfg.update(sql);
sql = "UPDATE sys_cfg SET value='" + request.getParameter("imgext")+ "' WHERE id=3";
pcfg.update(sql);
sql = "UPDATE sys_cfg SET value='" + request.getParameter("fileext")+ "' WHERE id=4";
pcfg.update(sql);
sql = "UPDATE sys_cfg SET value='" + request.getParameter("imgsize")+ "' WHERE id=5";
pcfg.update(sql);
sql = "UPDATE sys_cfg SET value='" + request.getParameter("filesize")+ "' WHERE id=6";
pcfg.update(sql);
sql = "UPDATE sys_cfg SET value='" + request.getParameter("lxr")+ "' WHERE id=7";
pcfg.update(sql);
sql = "UPDATE sys_cfg SET value='" + request.getParameter("lxfs")+ "' WHERE id=8";
pcfg.update(sql);
sql = "UPDATE sys_cfg SET value='" + request.getParameter("copyright")+ "' WHERE id=9";
pcfg.update(sql);
sql = "UPDATE sys_cfg SET value='" + request.getParameter("savepath")+ "' WHERE id=10";
pcfg.update(sql);
sql = "UPDATE sys_cfg SET value='" + request.getParameter("permission")+ "' WHERE id=11";
pcfg.update(sql);
sql = "UPDATE sys_cfg SET value='" + request.getParameter("ismydoc")+ "' WHERE id=12";
pcfg.update(sql);


sql = "SELECT * FROM web_counter WHERE id=1";
ResultSet rs = pcfg.query(sql);
rs.next();
if(!(((request.getParameter("date")).trim()).equals((rs.getString("createDate")).trim()))){
	sql = "UPDATE web_counter SET createDate='" + request.getParameter("date")+ "',counter=0,todayCounter=0,maxDate='" + request.getParameter("date")+ "',maxCounter=0 WHERE id=1";
	pcfg.update(sql);
}

pcfg.closestmt();
pcfg.closeconn();

response.sendRedirect("adminsys.jsp");
%>